package com.example.mykotilin.viewpager2

import android.widget.CheckBox
import androidx.viewpager2.widget.ViewPager2

class UserInputController(private val viewPager: ViewPager2, private val disableBox: CheckBox) {
    fun setUp() {
        disableBox.isChecked = !viewPager.isUserInputEnabled   //viewpager是否可用

        disableBox.setOnCheckedChangeListener { _, isDisable ->
            viewPager.isUserInputEnabled = !isDisable
        }
    }
}